# encoding: utf-8import pymysqlimport osdef get_table_info(cursor, table, data_name):    '''    :param cursor:    :param table:    :param data_name:    :return:    '''    data_info = []    sql = "select COLUMN_NAME from information_schema.columns where table_name='{table}'and TABLE_SCHEMA='{data_name}'".format(        table=table, data_name=data_name)    cursor.execute(sql)    resulte = cursor.fetchall()    for i in range(len(resulte)):        data_info.append(str(resulte[i][0]).encode('utf-8'))    return data_info